
<!DOCTYPE html>
<html class="client-nojs" lang="en" dir="ltr">
<head>
<meta charset="UTF-8"/>
<title>Chromatic aberration - PanoTools.org Wiki</title>




<style media="screen" type="text/css" title="Screen style sheet"> @import url(manual.css); </style>

<meta name="generator" content="MediaWiki 1.35.3"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>





<!--[if lt IE 9]><![endif]-->
</head>
<body class="mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-Chromatic_aberration rootpage-Chromatic_aberration skin-vector action-view skin-vector-legacy">


<div id="content" class="mw-body" role="main">
	<a id="top"></a>
	
	
	<h1 id="firstHeading" class="firstHeading" lang="en">Chromatic aberration</h1>
	<div id="bodyContent" class="mw-body-content">
		<div id="siteSub" class="noprint">From PanoTools.org Wiki</div>
		
		
		
		
		
		
		<div id="mw-content-text" lang="en" dir="ltr" class="mw-content-ltr"><div class="mw-parser-output"><p><br />
</p>
<div id="toc" class="toc" role="navigation" aria-labelledby="mw-toc-heading"><input type="checkbox" role="button" id="toctogglecheckbox" class="toctogglecheckbox" style="display:none" />
<ul>







</ul>
</div>

<h2><a name="Intro"><span class="mw-headline">Intro</span></a></h2>
<p>Color fringes can be very annoying, especially in stitched panoramas. Since they often appear nearer to the edges of single images they are near to any seam between two images in the panorama. Even worse, they change color where they cross the seam. 
</p><p>Hence chromatic aberration should be corrected if visible otherwise, at least for full screen or printed panoramas where you allow to zoom in to the native camera resolution. While correction is relatively easy CA can not be automatically determined like f.e. <a href="Barrel_distortion.html" title="Barrel distortion">barrel distortion</a>. Only visual judgement can give you enough control of the result. Unfortunately it needs some experience to do this.
</p>
<h2><a name="What_it_is"><span class="mw-headline">What it is</span></a></h2>
<p>Chromatic aberration is a common lens error visible in images as colored fringes or colored blur along edges. It is caused by a different refractive index of glass for light at different wavelength. There is a nice description with lots of links on wikipedia:Chromatic aberration<a class="external" href="http://www.wikipedia.org/wiki/Chromatic_aberration">[*]</a>. 
</p><p>Another good description is found on <a rel="nofollow" class="external text" href="http://www.vanwalree.com/optics/chromatic.html">Paul van Walree's</a> page.
</p>
<h3><a name="LCA"><span class="mw-headline">LCA</span></a></h3>
<p>Different refractive index means different <a href="Focal_Length.html" title="Focal Length">Focal Length</a> for a single lens. This would lead to different focal planes for different colors. You would have to focus differently for red, blue or green. This effect is called <b>longitudinal chromatic aberration</b> (LCA). If you have a fringe near the image center that changes color if you defocus slightly, this is most likely longitudinal chromatic aberration. This type:
</p>
<ul><li>can not be corrected by software</li>
<li>gets less if stopped down</li>
<li>is dependent from focus distance.</li></ul>
<p><br />
</p>
<h3><a name="TCA"><span class="mw-headline">TCA</span></a></h3>
<p>When a lens is corrected for longitudinal chromatic aberration, different colors focus more or less in the same point on the optical axis, but they might focus in different distances off axis resulting in images of different size for different colors. This type is called lateral or <b>transverse chromatic aberration</b> (TCA). If you have complementary colored fringes progressively more from the center to the corners, this is most likely transverse chromatic aberration (although there are some exceptions as the <a href="Chromatic_aberration.html#Strange_Example">example</a> below illustrates). This type:
</p>
<ul><li>can be corrected by software</li>
<li>does not change by stopping down (stopping down would perhaps make the fringes sharper and lead to the impression TCA is reduced)</li>
<li>is dependent from focus distance.</li></ul>
<h2><a name="What_it_is_not"><span class="mw-headline">What it is not</span></a></h2>
<p>Digital photography introduced some new types of color fringes, that are not lens chromatic aberration. They are frequently confused with TCA and unfortunately they occur often mixed with TCA. These effects might be visible as purple or blue fringes and are visible around overexposed areas in most cases.
</p><p>They might have different causes: 
</p>
<ul><li>By sensor overflow visible as blooming. This blooming often has a purple color because of the bayer pattern of the sensor: If a sensor cell overflows to the neighboring cells all cells are affected the same. There are 50% green but only 25% red and 25% blue sensor cells. Hence blue and red are weighted more resulting in purple fringes around overexposed areas. Since CMOS sensors are not prone to overflow this affects only CCD sensors.</li>
<li>By chromatic aberration and other errors in the micro lenses that are in front of the sensor.</li>
<li>By reflections between the sensor and the protective glass (that might be coated and hence reflects colored).</li>
<li>By <a href="Interpolation.html" title="Interpolation">interpolation</a> errors or anti moire filters.</li>
<li>By partial color saturation: Blue sky f.e. might be clipped to pure white because all color channels are saturated. If there is a blurred dark object in the image the sensors in the blur region receive only part of the light and hence don't saturate. The blur region appears blue. This is the only effect that applies to analog film as well.</li></ul>
<h2><a name="How_to_avoid"><span class="mw-headline">How to avoid</span></a></h2>
<p>LCA can be avoided if shot stopped down. Purple or blue fringes might benefit from stopping down, too. They can be avoided in most cases if you expose for the highlights (i.e. don't overexpose). TCA can only not be avoided if you can use a better lens. Fixed <a href="Focal_Length.html" title="Focal Length">Focal Length</a> lenses are less prone to TCA than cheap zoom lenses. Converters are often very bad. You can avoid TCA while stitching if you don't use the corners where it is most prominent.
</p>
<h2><a name="How_to_distinguish"><span class="mw-headline">How to distinguish</span></a></h2>
<p>If you want to correct color fringes by software you need to know which type they are. If all of the following points are met your image most likely contains true TCA:
</p>
<ul><li>Corners should show most color fringes whereas the center should show none.</li>
<li>Color fringes should be not only at the edges of overexposed areas but at lower contrast edges, too.</li>
<li>Color fringes should be of complementary color (red-cyan, blue-yellow or purple-green) on opposite sides of a dark or bright area.</li>
<li>Color fringes should be in all corners the same direction pointing out from the center.</li></ul>
<h3><a name="Difficulties_to_view"><span class="mw-headline">Difficulties to view</span></a></h3>
<div class="thumb tright"><div class="thumbinner" style="width:452px;"><a class="external" href="https://wiki.panotools.org/File:CA_artifical_R_C.jpg"><img alt="" src="CA_artifical_R_C.jpg" decoding="async" width="450" height="300" class="thumbimage" /></a>  <div class="thumbcaption">Artificial Red-Cyan TCA</div></div></div>
<div class="thumb tright"><div class="thumbinner" style="width:452px;"><a class="external" href="https://wiki.panotools.org/File:CA_artifical_B_Y.jpg"><img alt="" src="CA_artifical_B_Y.jpg" decoding="async" width="450" height="300" class="thumbimage" /></a>  <div class="thumbcaption">Artificial Blue-Yellow TCA</div></div></div>
<p>If you want to test your lens for CA the subject you shoot is critical. The visibility of TCA highly depends on the colors forming contrast edges. Here two artificial examples to illustrate this. In both images TCA was introduced by sizing one channel to 101%. In the upper image this was the red channel causing red-cyan fringes in the lower image sizing the blue channel to 101% caused blue-yellow fringes.
</p><p>Please have a close look at the half with the azure background in both images. The cyan fringes in the upper image are not visible at all with dark green foreground, the red fringes turn into an almost invisible dark brown. 
</p><p>In the lower image both blue and yellow fringes are invisible on the more saturated yellow background. Where it turns to a lighter shade of yellow the blue fringes appear purple. The yellow fringes are green on the azure background.
</p><p>This shows that the best subject for CA determination is composed of neutral greys, black and not overexposed white. The following example is a quite good one - not overexposed, grey sky and no saturated colors.<br style="clear:both;" />
</p>
<h3><a name="Example_with_true_TCA"><span class="mw-headline">Example with true TCA</span></a></h3>
<p>This image is reduced to 30% but still shows heavy TCA as a result of the usage of a cheap wide angle converter:
</p>
<div class="thumb tnone"><div class="thumbinner" style="width:770px;"><a class="external" href="https://wiki.panotools.org/File:CA_tCA00.jpg"><img alt="" src="CA_tCA00.jpg" decoding="async" width="768" height="576" class="thumbimage" /></a>  <div class="thumbcaption">Image courtesy of &#169; Thomas Niemann</div></div></div>
<p>Here a crop of the upper left corner, enlarged to 200%. To verify this is true TCA you can simply cycle through the color channels (f.e. by pressing Ctrl+1, Ctrl+2 and Ctrl+3 in Photoshop<a class="external" href="https://wiki.panotools.org/Photoshop">[*]</a>). If the whole image content in areas with more or less neutral colors seems to move this is true TCA:
</p><p><img alt="CA tCA01.jpg" src="CA_tCA01.jpg" decoding="async" width="320" height="320" /> <img alt="CA tCA01.gif" src="CA_tCA01.gif" decoding="async" width="320" height="320" />
</p><p><small>switch on GIF animation to see the different channels in the right image</small>
</p><p>The whole image content seems to move if channels change. This is clearly due to TCA. As you can see, the channels have different sharpness. This is most likely due to longitudinal CA.
</p><p>For comparison a similar sized and enlarged crop from the center:
</p><p><img alt="CA tCA03.jpg" src="CA_tCA03.jpg" decoding="async" width="320" height="320" />
</p><p>There are no color fringes in the center. A good indicator of true TCA.
</p><p>You can try to correct TCA by hand in one corner in Photoshop<a class="external" href="https://wiki.panotools.org/Photoshop">[*]</a> to see whether it is worth the effort to correct it in total:
</p>
<ul><li>crop to a corner with visible TCA</li>
<li>enlarge by 200% to 400%</li>
<li>flatten image if needed.</li>
<li>try to nudge the red and the blue channel in order to minimze fringes. To do this, in the channels palette:
<ul><li>Click the red channel to make it the active one.</li>
<li>Click the small eye symbol of the RGB channel in order to make all colors visible</li>
<li>Choose the move tool from the tools palette</li>
<li>Nudge the red channel with the arrow keys until the fringes are blue-yellow</li>
<li>repeat the same for the blue channel and nudge to optimum</li>
<li>repeat for the red channel if there are still red-green fringes</li></ul></li></ul>
<p>Here is the above example after using this technique.
</p><p><img alt="CA tCA02.jpg" src="CA_tCA02.jpg" decoding="async" width="320" height="320" />
</p><p>The remaining light blue fringes can not be corrected. They are most likely not lens TCA but an effect as described under <a href="Chromatic_aberration.html#What_it_is_not">What it is not</a>.
</p>
<h3><a name="Example_with_no_TCA_but_purple_fringes"><span class="mw-headline">Example with no TCA but purple fringes</span></a></h3>
<p>This image is reduced to 40%. It shows purple fringes but no chromatic aberration:
</p><p><img alt="CA fringes00.jpg" src="CA_fringes00.jpg" decoding="async" width="640" height="480" />
</p><p>Here the enlargement of the upper left corner and the moving channels:
</p><p><img alt="CA fringes01.jpg" src="CA_fringes01.jpg" decoding="async" width="320" height="320" /> <img alt="CA fringes01.gif" src="CA_fringes01.gif" decoding="async" width="320" height="320" />
</p><p><small>(switch on GIF animation to see the different channels in the right image)</small>
</p><p>As you can notice, the details on the grey tree don't move at all. It's only the left (outside) side of the overexposed sky areas that changes.
</p><p><br />
</p>
<h3><a name="Strange_Example"><span class="mw-headline">Strange Example</span></a></h3>
<p>This crop (lower left corner) is from a frequently used combo: Nikon D70 with Nikkor 10.5mm full frame fisheye (image (c) Andrey Ilyin). At the first glance this looks like normal red-cyan TCA. But if you try to correct this one, it will drive you nuts. Have a close look on the moving channels:
</p><p><img alt="CA strange01.jpg" src="CA_strange01.jpg" decoding="async" width="320" height="320" /> <img alt="CA strange01.gif" src="CA_strange01.gif" decoding="async" width="320" height="320" />
</p><p><small>(switch on GIF animation to see the different channels in the right image)</small>
</p><p>As you can see part of the image details move but part doesn't (the blade of grass in the center). If you minimize the fringes there will be new fringes or even double details with different color:
</p><p><img alt="CA strange02.jpg" src="CA_strange02.jpg" decoding="async" width="320" height="320" /> 
</p><p>This weird kind of colored fringes is definitely not lens CA. I can only think of some effects of bayer interpolation, but this is wild guess.
</p>
<h2><a name="How_to_correct"><span class="mw-headline">How to correct</span></a></h2>
<p>In many cases it would be enough to adjust the size of the color channels to correct for TCA. However, correction might not always be satisfactory even if it is of the true tCA type. This might have different causes: 
</p>
<ul><li>There might be a rest of LCA in the image. In this cases one or two color channels can be blurred. This is partly the case in the <a href="Chromatic_aberration.html#Example_with_true_TCA">Example with true TCA</a>. You can try to selectively sharpen<a class="external" href="https://wiki.panotools.org/Sharpening">[*]</a> the questionable channels. Since unsharp masking works best on gaussian blur but CA blur is more of the radial blur type this probably won't work very good.</li>
<li>Images where <a href="JPEG.html" title="JPEG">JPEG</a> compressed (too much). If you shift the color channels of previously jpeg compressed images you emphasize the jpeg artifacts. It is a better idea to work on <a href="TIFF.html" title="TIFF">TIFF</a> images converted directly from <a href="RAW.html" title="RAW">RAW</a> or scanned directly.</li>
<li>Adjustment is too coarse. Depending on the resolution of the image sub-pixel alignment might be necessary.</li></ul>
<h3><a name="Easy"><span class="mw-headline">Easy</span></a></h3>
<p>The most convenient way to correct TCA is to use a tool like the Adobe Raw Converter, Picture Window Pro or PTLens<a class="external" href="https://wiki.panotools.org/PTLens">[*]</a> offer. You zoom into a corner with good details and use a pair of sliders to adjust the image size for the red channel (red-cyan fringes) and the blue channel (blue-yellow fringes - the purple-green type is a mixture of red-cyan and blue-yellow type). Both ways allow for sub-pixel adjustment.
</p><p>This technique (including sub pixel adjustment) can be peformed by hand with any image editor that can make size adjustments to single channels. If the step size is too large, the image can be upsampled prior to correction.
</p><p>However, if you use one of those easy approaches look closely at different areas of the image - especially different distances from the image center. It could well be that correction in one area causes fringes in another one. If this is the case TCA in this image doesn't follow an easy linear scheme and hence can't be corrected this way - see next paragraph.
</p>
<h3><a name="Precise"><span class="mw-headline">Precise</span></a></h3>
<p><a href="Panorama_tools.html" title="Panorama tools">Panorama tools</a> Radial Shift<a class="external" href="https://wiki.panotools.org/Panorama_Tools_Plugins#Radial_Shift">[*]</a> filter allows for separate correction of red, green and blue channel using a third degree polinomial. This kind of curve should be complex enough to correct for any kind of non-linear TCA. 
</p><p>Unfortunately it was very difficult to estimate the correct values until 2004 when <a rel="nofollow" class="external text" href="http://photocreations.ca/radial_distortion/">Jim Watters</a> and <a rel="nofollow" class="external text" href="http://www.erik-krause.de/ca">Erik Krause</a> found a way to determine suitable correction coefficients using different calculation approaches.
</p><p>Based on this work <a rel="nofollow" class="external text" href="http://www.pinlady.net/vr/">Eric Gerds</a> developed a Photoshop CS Javascript called PTShift<a class="external" href="https://wiki.panotools.org/PTShift">[*]</a> that allows for manual correction in different areas and passes the found deviations as virtual control points to <a href="PTOptimizer.html" title="PTOptimizer">PTOptimizer</a> in order to calculate correction coefficients.
</p><p>Alternatively the correction coefficients can be calculated entirely with <a href="Hugin.html" title="Hugin">hugin</a> and <a href="PTOptimizer.html" title="PTOptimizer">PTOptimizer</a>, for more details see this <a rel="nofollow" class="external text" href="http://hugin.sourceforge.net/tutorials/tca/">hugin tutorial on correcting TCA</a>.  For more precise results, <a rel="nofollow" class="external text" href="http://www.gnu.org/software/octave/">octave</a> (script on the hugin page: <a rel="nofollow" class="external autonumber" href="http://hugin.sourceforge.net/tutorials/tca/en.shtml">[1]</a>) can be used to calculate the coefficients rather than <a href="PTOptimizer.html" title="PTOptimizer">PTOptimizer</a>.  An alternative to the Radial Shift<a class="external" href="https://wiki.panotools.org/Panorama_Tools_Plugins#Radial_Shift">[*]</a> filter is <a href="Fulla.html" title="Fulla">fulla</a> which can also correct TCA, <a href="Barrel_distortion.html" title="Barrel distortion">barrel distortion</a> and <a href="Vignetting.html" title="Vignetting">vignetting</a> at the same time.
</p><p><small>Erik Krause<a class="external" href="https://wiki.panotools.org/User:Erik_Krause">[*]</a> 17:18, 2 May 2005 (EDT)</small>
</p>
<h2><a name="External_links"><span class="mw-headline">External links</span></a></h2>
<ul><li>Wikipedia:Chromatic aberration<a class="external" href="http://www.wikipedia.org/wiki/Chromatic_aberration">[*]</a></li>
<li><a rel="nofollow" class="external text" href="http://www.dpreview.com/learn/?/Glossary/Optical/chromatic_aberration_01.htm">dpreview on chromatic aberration</a></li>
<li>Michel Thoby's article <a rel="nofollow" class="external text" href="http://michel.thoby.free.fr/Compare_Fisheyes/Correction_TCA/Illusion_and_reality_TCA.html">Illusion and reality - How does TCA look like?</a></li></ul>

<!--
Transclusion expansion time report (%,ms,calls,template)
100.00%   29.553      1 -total
 50.02%   14.783      1 Template:Clr
 49.59%   14.655      1 Template:Glossary
-->


</div></div><div class="printfooter">Retrieved from "<a dir="ltr" href="https://wiki.panotools.org/index.php?title=Chromatic_aberration&amp;oldid=13736">https://wiki.panotools.org/index.php?title=Chromatic_aberration&amp;oldid=13736</a>"</div>
		</div></div></body></html>